<script src="vue.js"></script>
<div id="app"><prpet></prpet>
</div>
<template id="chaild1">
    <div>
        <button @click="send">发送</button>
        <input type="text" v-model="msg"/>
    </div>
</template>
<script>
    Vue.component('prpet',{
        data(){
            return{
                msg:''
            }
        },
        template:'<div><child @childfn="prpetfn""></child>'+"获取子组件的信息为:{{msg}}</div>",
    methods:{
    prpetfn(value){
        this .msg=value;
    }
    }
    });
    vue.component('child',{
        data(){
            return{
                msg:''
            }
        },
        methods:{
            send(){
                this.$emit('childfn',this.msg)

            }
        }
    })
    varvue=new Vue({
el:"#app",
})
</script>